import React from 'react';
import {inject, observer} from 'mobx-react';
import * as mobx from 'mobx';
import {getAntd, getEcCom, getLabel} from '../../../util/convert';
import Content from './Content';

@inject('rejectStore')
@observer
export default class Main extends React.Component {
    render() {
        const {WeaDialog} = getEcCom();
        const {visible, rejectStore} = this.props;
        const {baseParams = {}} = rejectStore;
        let dialogHeight = "500px";
        //只需要选择退回后再提交到达节点时，dialog的高度缩小
        if (!(baseParams.isrejectremind == "1" && baseParams.ischangrejectnode == "1") && baseParams.isselectrejectnode === "0" && baseParams.isSubmitDirectNode == "2") {
            dialogHeight = "200px";
        }
        return (
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@faydjt`}
                visible={visible}
                loadCss={true}
                initLoadCss={true}
                title={getLabel(84508, '退回设置')}
                icon="icon-coms-workflow"
                iconBgcolor='#0079DE'
                maskClosable={false}
                onCancel={this.doCancel}
                style={{width: "720px", height: dialogHeight}}
                layout={jQuery('.wf-req')[0]}
            >
                <Content ecId={`${this && this.props && this.props.ecId || ''}_Content@5qg60o`} {...this.props} />
            </WeaDialog>
        )
    }

    doCancel = () => {
        const {rejectStore} = this.props;
        rejectStore.cancelEvent();
    }
}